//
//  RXViewController.swift
//  SwiftTest
//
//  Created by appleTwo on 2019/5/23.
//  Copyright © 2019 QiKai. All rights reserved.
//

import UIKit

class RXViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        self.title = "rx";
        self.creatUI()
    }
    private func creatUI(){
        
        
    }
    func chooseStepFunction(backward: Bool) -> (Int) -> Int {
        func stepForward(input: Int) -> Int { return input + 1 }
        func stepBackward(input: Int) -> Int { return input - 1 }
        return backward ? stepBackward : stepForward
    }

    let names = ["Chris", "Alex", "Ewa", "Barry", "Daniella"]
    func backward(_ s1: String, _ s2: String) -> Bool {
        return s1 > s2
    }
    var reversedNames:[String]!{
        get{
            return  names.sorted(by: backward)
        }
    }
 

}
extension RXViewController{
    func addTwoInts(_ a: Int, _ b: Int) -> Int {
        return a + b
    }
    func multiplyTwoInts(_ a: Int, _ b: Int) -> Int {
        return a * b
    }
    
}



